#pragma once
#include <vector>
#include <unordered_map>

using namespace std;

namespace twoSum
{
	class Solution {
	public:
		vector<int> twoSum(vector<int>& nums, int target) {
			unordered_map<int, int> data;
			for (int i = 0; i < nums.size(); i++)
			{
				int other = target - nums[i];
				if (data.find(other) == data.end())
				{
					data[nums[i]] = i;
				}
				else
				{
					return { i, data[other] };
				}
			}
			return { 0, 0 };
		}
	};
}